package com.atlin.project.service;


import com.atlin.beaconsapicommon.model.domain.SysUser;
import com.atlin.beaconsapicommon.model.domain.interfaceInfo.InterfaceInfo;
import com.atlin.beaconsapicommon.model.domain.interfaceInfo.InvokeRequestField;
import com.atlin.project.model.dto.interfaceInfo.InterfaceInfoQueryRequest;
import com.atlin.project.model.vo.InterfaceInfoVO;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @author atlin
 * @description interfaceInfo
 * @createDate date
 */
public interface InterfaceInfoService extends IService<InterfaceInfo> {

    /**
     * 接口总调用次数统计
     *
     * @return 统计条目数
     */
    int totalInvokeCount();

    void valid(InterfaceInfo interfaceInfo, boolean add);

    /**
     * 获取封装
     *
     * @param interfaceInfo
     * @param request
     * @return
     */
    InterfaceInfoVO getInterfaceInfoVO(InterfaceInfo interfaceInfo, HttpServletRequest request);


    /**
     * 获取查询条件
     *
     * @param questionQueryRequest
     * @return
     */
    QueryWrapper<InterfaceInfo> getQueryWrapper(InterfaceInfoQueryRequest questionQueryRequest);

    /**
     * 分页获取封装
     *
     * @param questionPage
     * @param request
     * @return
     */
    Page<InterfaceInfoVO> getInterfaceInfoVOPage(Page<InterfaceInfo> questionPage, HttpServletRequest request);

    /**
     * 接口测试调用
     *
     * @param interfaceInfoId 接口信息ID
     * @return 调用返回结果
     */
    Object testInterfaceInvoke(long interfaceInfoId, List<InvokeRequestField> paramList);

    /**
     * 接口调用
     *
     * @param interfaceInfoId 接口信息ID
     * @return 调用返回结果
     */
    Object remoteInterfaceInvoke(SysUser loginUser, long interfaceInfoId, List<InvokeRequestField> paramList);


}
